package com.example.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 座位预约时间段DTO
 * 
 * @author HP
 * @description 用于返回座位预约时间段信息
 * @createDate 2025-08-31
 */
@Data
public class SeatReservationTimeSlotDTO implements Serializable {

    /**
     * 预约记录ID
     */
    private Long reservationId;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 用户名
     */
    private String username;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    /**
     * 预约状态 0:待签到, 1:已签到, 2:已取消, 3:已超时
     */
    private Integer reservationStatus;

    /**
     * 签到时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date signTime;

    /**
     * 预约状态描述
     */
    public String getStatusDescription() {
        if (reservationStatus == null) {
            return "未知状态";
        }
        switch (reservationStatus) {
            case 0:
                return "待签到";
            case 1:
                return "已签到";
            case 2:
                return "已取消";
            case 3:
                return "已超时";
            default:
                return "未知状态";
        }
    }

    private static final long serialVersionUID = 1L;
}